#ifndef _CURL_MULTI_TASK_H_
#define _CURL_MULTI_TASK_H_
namespace HNNetWork {

#define HTTPTASKE_OK            0
#define HTTPTASKE_ERROR         1


typedef enum
{
    STATUS_BASE                     = 0,

    STATUS_IDLE,
    STATUS_RUNNING,
    STATUS_FINISHED_OK,
    STATUS_FINISHED_ERROR,
}HttpTaskStatus_e;


int httptask_init(void);
int httptask_deinit(void);

int httptask_addfiletask(const char* url_s, int timeout_s,
        const char* filename_s,
        const char* checkmd5sum_s, long checksize_s);
int httptask_addbuffertask(const char* url_s, int timeout_s,
        char* buffer_s, long size_buffer_s,
        const char* checkmd5sum_s, long checksize_s);

int httptask_run(void);
int httptask_asynrun(void);

int httptask_getitemstatus(int i, HttpTaskStatus_e* status_e, int* percent);
int httptask_getstatus(HttpTaskStatus_e* status_e, int* percent);
}
#endif
